<%# more info: https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce %>
ga('require', 'ec');
ga('set', '&cu', '<%= current_currency %>');

<%= render partial: 'spree/shared/google_add_items.js', locals: { order: order } %>

ga('ec:setAction', 'purchase', { // Transaction details are provided in an actionFieldObject.
  'id': '<%= j order.number %>', // Transaction ID. Required.
  'affiliation': '<%= current_store.name %>', // Affiliation (string).
  'revenue': '<%= order.total %>',   // Revenue (currency).
  'tax': '<%= @order.tax_total %>',   // Tax.
  'shipping': '<%= @order.ship_total %>' // Shipping.
});
